#include <iostream>
#include <vector>
using namespace std;
int date1,date2;
int mouthday[12]={31,28,31,30,31,30,31,31,30,31,30,31};
bool IsYunYear(int year)
{
	return (year/400==0||(year/4==0)&&(year/100!=0));
}
int next(int date)
{
	int nextdate=date;
	if(==2&&&&IsYunYear(date/1000))
	
	
	
	return nextdate;
}
int main()
{
	
	int ret=0;
	cin>>date1>>date2;
	while(date1<=date2)
	{
		int flag=1;
		int left=0;int right=7;
		while(right>=left)
		{
			if(date1[left]!=date2[right])
			{
				flag=0;
				break;
			}
			right++;left++;
		}
		if(flag)
		ret++;
		date1=next(date1);
	}
	return 0;
}
